package com.bizframework.security.service;

import java.util.List;

import com.bizframework.security.domain.entity.Group;
import com.bizframework.security.domain.entity.User;

import com.bizframework.core.domain.ListResult;
import com.bizframework.core.domain.QueryCondition;
import com.bizframework.core.domain.SortInfo;

public interface PopedomManagerService {
	/**
	 * 添加用户
	 * @param user
	 */
	void addUser(User user) throws Exception;
	/**
	 * 保存用户
	 * @param user
	 */
	void saveUser(User user) throws Exception;
	
	void deleteUser(String userId) throws Exception;
	
	User getUserById(String userId) throws Exception;
	
	User getUserByName(String userName) throws Exception;
	
	boolean hasUserName(String userName) throws Exception;
	
	void updateUserGroups(String userId, List<String> groupIds) throws Exception;
	
	void addGroupToUser(String userId, String groupId) throws Exception;
	
	void deleteGroupFormUser(String userId, String groupId) throws Exception;
	
	public List<User> findUsersByConditions(List<QueryCondition> conditions, SortInfo sortInfo) throws Exception;
	
	public ListResult<User> findUsersByConditions(List<QueryCondition> conditions, int startIndex, int count, SortInfo sortInfo) throws Exception;
	
	void addGroup(Group group) throws Exception;
	
	void saveGroup(Group group) throws Exception;
	
	void deleteGroup(String groupId) throws Exception;
	
	Group getGroupById(String groupId) throws Exception;
	
	void updateGroupUsers(String groupId, List<String> userIds) throws Exception;
	
	void updateGroupPermissions(String groupId, List<String> permissionIds) throws Exception;
	
	void addUserToGroup(String groupId, String userId) throws Exception;
	
	void deleteUserFormGroup(String groupId, String userId) throws Exception;
	
	public List<Group> findGroupsByConditions(List<QueryCondition> conditions, SortInfo sortInfo) throws Exception;
	
	public ListResult<Group> findGroupsByConditions(List<QueryCondition> conditions, int startIndex, int count, SortInfo sortInfo) throws Exception;
	
	public void updateUser(User user) throws Exception;
	
	public void updateGroup(Group group) throws Exception;
}
